package sh.wn36.vehiclemanage.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.beans.factory.annotation.Autowired;
import sh.wn36.vehiclemanage.entity.Dictionary;
import sh.wn36.vehiclemanage.mapper.DictionaryMapper;
import sh.wn36.vehiclemanage.service.DictionaryService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import sh.wn36.vehiclemanage.xzh.DictionaryInfo;

import java.util.List;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author xk
 * @since 2021-04-26
 */
@Service
public class DictionaryServiceImpl extends ServiceImpl<DictionaryMapper, Dictionary> implements DictionaryService {
    @Autowired
    private  DictionaryMapper dictionaryMapper;

    @Override
    public List<Dictionary> listById() {
        return dictionaryMapper.selectByIds();
    }
    @Override
    public List<String> getLargeClassificationList() {
        return dictionaryMapper.getLargeList();
    }

    @Override
    public Dictionary getByText(String largeClassification) {
        return dictionaryMapper.getByTest(largeClassification);
    }

    @Override
    public List<Dictionary> getListByPidAndLev(Integer pid,Integer lev) {
        return dictionaryMapper.getByPidAndLev(pid,lev);
    }


    @Override
    public List<Dictionary> getListBySonPid(Integer id) {
        return dictionaryMapper.getListBySonPid(id);
    }

    @Override
    public List<Dictionary> getListByPid(Integer id) {
        return dictionaryMapper.getByPid(id);
    }

    //根据pid查询部门
    @Override
    public List<Dictionary> getPid(int i) {
        return dictionaryMapper.getPid(i);
    }

    @ApiModelProperty("根据部门名称获取id")
    @Override
    public Dictionary finddept(String dname) {
        Dictionary finddept = dictionaryMapper.finddept(dname);
        return finddept;
    }



    @Override
    public IPage<DictionaryInfo> getList(Page<DictionaryInfo> page) {
        return dictionaryMapper.getList(page);
    }

    @Override
    public IPage<DictionaryInfo> getListByMini(Page<DictionaryInfo> page, String miniClassification) {
        return dictionaryMapper.getListByMini(page,miniClassification);
    }

    @Override
    public IPage<DictionaryInfo> getListByMiddle(Page<DictionaryInfo> page, String middleClassification) {
        return dictionaryMapper.getListByMiddle(page,middleClassification);
    }

    @Override
    public IPage<DictionaryInfo> getListByLarge(Page<DictionaryInfo> page, String largeClassification) {
        return dictionaryMapper.getListByLarge(page,largeClassification);
    }

    @Override
    public List<DictionaryInfo> getListByLev(Integer lev) {
        return dictionaryMapper.getPListByLev(lev);
    }


    @Override
    public List<Dictionary> listByIdInsu() {
        return dictionaryMapper.listByIdInsu();
    }

    @Override
    public List<Dictionary> listByIdRefuel() {
        return dictionaryMapper.listByIdRefuel();
    }
}
